const express = require('express')
const router = express.Router()
const { createUser, loginController, getUserController,updateUserController} = require('../controller/user')
const authMiddleware = require('../middleware/index/authMiddleware')

// 用户路由地址和控制器映射

// 定义路由模块
router.post('/', createUser)  //用户创建
router.post('/login', loginController)  //用户登录
//私有接口：需要token认证
router.get('/', authMiddleware, getUserController)  //用户获取
router.put('/', authMiddleware, updateUserController)  //用户修改


// 导出路由模块
module.exports = router